# -*- coding: utf-8 -*-
# 姓名:谚语
# 开发时间:2022/10/30 11:40
from comment.utils.Serializers import BaseSerializer


class AccountInfoSerializer(BaseSerializer):
    """用户资金账户的序列化"""

    def to_dict(self):
        obj = self.data
        return {
            'total': float(obj.total),  # 账户总额
            "balance": float(obj.balance),  # 账户可用余额
            "profit": float(obj.inverstmentA),  # 已投资总额
            "inverstmentW": float(obj.inverstmentW),  # 总计待收本金
            "interestTotal": float(obj.interestTotal),  # 总计待收利息
            'discount': float(obj.discount)  # 代金券
        }
